package com.zxx.pattern.visitorPattern.visitor1;

/**
 * 2.具体访问者。实现Visitor申明的每一个操作，每一个操作实现算法的一部分。
 * @author zxx on 2021/4/22
 */
public class ComputerPartVisitorDisplay implements ComputerPartVisitor {

    @Override
    public void visit(BeanComputer computer) {
        System.out.println("Displaying Computer.");
    }

    @Override
    public void visit(BeanKeyboard computer) {
        System.out.println("Displaying BeanKeyboard.");
    }

    @Override
    public void visit(BeanMonitor computer) {
        System.out.println("Displaying BeanMonitor.");
    }

    @Override
    public void visit(BeanMouse computer) {
        System.out.println("Displaying BeanMouse.");
    }
}
